package com.utooo.controller;


import com.utooo.constant.ResultCodeConstant;
import com.utooo.pojo.dto.common.CreateGroup;
import com.utooo.pojo.dto.common.RestResult;
import com.utooo.pojo.dto.purchase.price.PriceUpdateStatusDto;
import com.utooo.pojo.dto.supplier.execution.PurchaseUpdateDto;
import com.utooo.service.purchase.PriceCenterService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @Description: TODO
 * @Author SJD
 * @Date: 2025/4/27 14:31
 * @Copyright: 南京优通信息科技股份有限公司
 */
@Tag(name = "价格中心-价格库")
@RequestMapping("/supplier/pricecenter")
@RestController
@RequiredArgsConstructor
public class PriceCenterController {

    private final PriceCenterService priceCenterServiceImpl;

    @RequestMapping(value = "/updateStatus", method = RequestMethod.POST)
    @Operation(summary = "更改价格状态为无效")
    @ResponseBody
    public RestResult<Boolean> updateStatus(@RequestBody @Validated(CreateGroup.class) PriceUpdateStatusDto param) {
        Boolean result = priceCenterServiceImpl.updateStatus(param);
        return new RestResult<>(ResultCodeConstant.CODE_200, ResultCodeConstant.CODE_200_MSG, result);
    }

}
